//
// CMeshMorpher.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CMeshMorpher {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CMeshMorpher(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CMeshMorpher obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CMeshMorpher(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setBlendShapes(SWIGTYPE_p_std__vectorT_NL3D__CBlendShape_t value) {
    nel3dJNI.CMeshMorpher_BlendShapes_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CBlendShape_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_NL3D__CBlendShape_t getBlendShapes() {
    long cPtr = nel3dJNI.CMeshMorpher_BlendShapes_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_NL3D__CBlendShape_t(cPtr, false);
  }

  public CMeshMorpher() {
    this(nel3dJNI.new_CMeshMorpher(), true);
  }

  public void init(CVertexBuffer vbOri, CVertexBuffer vbDst, boolean hasTgSpace) {
    nel3dJNI.CMeshMorpher_init(swigCPtr, this, CVertexBuffer.getCPtr(vbOri), vbOri, CVertexBuffer.getCPtr(vbDst), vbDst, hasTgSpace);
  }

  public void initSkinned(CVertexBuffer vbOri, CVertexBuffer vbDst, boolean hasTgSpace, Vector_CVector vVertices, Vector_CVector vNormals, Vector_CVector vTgSpace, boolean bSkinApplied) {
    nel3dJNI.CMeshMorpher_initSkinned(swigCPtr, this, CVertexBuffer.getCPtr(vbOri), vbOri, CVertexBuffer.getCPtr(vbDst), vbDst, hasTgSpace, Vector_CVector.getCPtr(vVertices), vVertices, Vector_CVector.getCPtr(vNormals), vNormals, Vector_CVector.getCPtr(vTgSpace), vTgSpace, bSkinApplied);
  }

  public void update(SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t pBSFactor) {
    nel3dJNI.CMeshMorpher_update(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t.getCPtr(pBSFactor));
  }

  public void updateSkinned(SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t pBSFactor) {
    nel3dJNI.CMeshMorpher_updateSkinned(swigCPtr, this, SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t.getCPtr(pBSFactor));
  }

  public void updateRawSkin(CVertexBuffer vbOri, SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CRawSkinVertex_p_false_t vertexRemap, SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t pBSFactor) {
    nel3dJNI.CMeshMorpher_updateRawSkin(swigCPtr, this, CVertexBuffer.getCPtr(vbOri), vbOri, SWIGTYPE_p_NLMISC__CObjectVectorT_NL3D__CRawSkinVertex_p_false_t.getCPtr(vertexRemap), SWIGTYPE_p_std__vectorT_NL3D__CAnimatedMorph_t.getCPtr(pBSFactor));
  }

  public void serial(IStream f) {
    nel3dJNI.CMeshMorpher_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

}
